<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<style>
.last_score {
    position: fixed;
    top: 70px;
    right: 0px;
    font-size: 100px;
    width: 200px;
    height: 100px;
    text-align: right;
}
</style>
<script type="text/javascript">
//拿到TextArea的DOM
var textarea=document.getElementById('textarea');
//设置高度
if(textarea != null){
	textarea.style.height = textarea.scrollHeight + 'px';
}

</script>
<div class="easyui-layout" fit="true">
	<div data-options="region:'center'" style="border: 0">
	<form id="savesoure" action="homework/savesoure" method="post">
		<div id="grade" class="last_score"></div>
		<input type="hidden" id="txt_score" name="txt_score" value="">
		<h1>
			<input type="hidden" value="${ct.id}">
				<a id="returnclass" href="#"><img class="imglog" alt="" src="public/images/back.png">&nbsp;${ct.name}(${stu.name})</a>
			<input type="hidden"  value="${ct.cla[0].id}">
		</h1>
		<input type="hidden" id="chuti_id" value="${ct.id}">
		<input type="hidden" id="cla_id" name="claid" value="${ct.cla[0].id}">
		<fieldset class="fs">
			<legend>基本信息</legend>
			<div class="left">
				<div class="exam_info">【试卷名称】：TR09-${ct.name}</div>
				<div class="exam_info">【出卷人】： ${ct.emp.name}</div>
				<div class="exam_info">【选择题数】：${ct.chooseCount}道题【判断题数】：${ct.opinionCount}道题【编程与简答题数】：${ct.programCount}道题</div>
				<div class="exam_info">【学习阶段】：${zj[0].dagang.name}</div>
				<div class="exam_info">【章节】：  
					<c:forEach items="${zj}" var="z">
						《${z.name}》
					</c:forEach>
				</div>
				<div class="exam_info">
					【派发部门】：
					<c:forEach items="${ct.cla}" var="c">
	   					${c.className}
	   				</c:forEach>
				</div>
				<div class="exam_info">【说明】：${empty ct.remark ? '无' : ct.remark}</div>
			</div>
		</fieldset>
		
		<div>
			<input type="hidden" id="zjid" value="${zj[0].id}" />
			<c:if test="${not empty choise.choises}">
			<fieldset
				style="border: none; width: 96%; margin-top: 10px; margin-left: 20px;">
				<legend style="font-weight: bold; padding-bottom: 10px;">选择题(共${choise.choises.size()}题)</legend>
				<div>
		    		<input class="easyui-numberbox"  name="sc"  style="width: 50px;text-align: center;">
					<a href="#" id="btn1" class="easyui-linkbutton btn1" >统一设置分数</a>
					<a href="#" class="easyui-linkbutton btn1" iconCls="">1</a>
					<a href="#" class="easyui-linkbutton btn1" iconCls="">2</a>
					<a href="#" class="easyui-linkbutton btn1" iconCls="">3</a>
					<a href="#" class="easyui-linkbutton btn1" iconCls="">4</a>
					<a href="#" class="easyui-linkbutton btn1" iconCls="">5</a>
					<a href="#" class="easyui-linkbutton btn1" iconCls="">6</a>
    			</div>
				<ol type="1" class="borderw" style="padding-left: 40px;">
					<c:forEach items="${choise.choises}" var="c" varStatus="status">
						<li class="li_question">
							<div class="question_title">
							<input type="hidden" name="choiseids" value="${c.id}"/>
							${status.index+1}、
							<c:choose>
								<c:when test="${choise.choisesanswer[status.index].answer != c.answer}">
									<input  name="select_score" type="text" style="width: 50px;text-align: center; font-weight:bold; color:red;" value="0">
								</c:when>
								<c:otherwise>
									<input class="" id="" type="text" name="select_score"  style="width: 50px;text-align: center;font-weight:bold;color:blue;">
								</c:otherwise>
							</c:choose>
								${c.title}(选${c.answer.length()}项) <span class="correct_answer">
									<c:choose>
										<c:when test="${empty choise.choisesanswer[status.index].answer}">
											<font color="red">未答</font>
										</c:when>
										<c:when
											test="${choise.choisesanswer[status.index].answer != c.answer}">
											<font color="red">${choise.choisesanswer[status.index].answer}</font>
										</c:when>
										<c:otherwise>	
										 		${choise.choisesanswer[status.index].answer}
										</c:otherwise>
									</c:choose>
								</span>
								<c:if
									test="${choise.choisesanswer[status.index].answer != c.answer}">
					 						 (正确答案：${c.answer})
								  			</c:if>
							</div>
							<ol type="A" style="padding-left: 0px;">
								<c:choose>
									<c:when test="${c.answer.length() == 1}">
										<input type="hidden" name="answercid" value="${c.id }" />
										<li>A、${c.optionA}</li>
										<li>B、${c.optionB}</li>
										<li>C、${c.optionC}</li>
										<li>D、${c.optionD}</li>
									</c:when>
									<c:otherwise>
										<input type="hidden" name="answercid" value="${c.id }" />
										<li>A、${c.optionA}</li>
										<li>B、${c.optionB}</li>
										<li>C、${c.optionC}</li>
										<li>D、${c.optionD}</li>
									</c:otherwise>
								</c:choose>

							</ol>
						</li>
					</c:forEach>
				</ol>
			</fieldset>
			</c:if>
			<c:if test="${not empty opinion.opinions}">
			<fieldset
				style="border: none; width: 96%; margin-top: 10px; margin-left: 20px;">
				<legend style="font-weight: bold; padding-bottom: 10px;"">判断题(共${opinion.opinions.size()}题)</legend>
				<div>
		    		<input class="easyui-numberbox" name="dc" style="width: 50px;text-align: center;">
					<a href="#" id="btn2" class="easyui-linkbutton btn2" iconCls="">统一设置分数</a>
					<a href="#" class="easyui-linkbutton btn2" iconCls="">1</a>
					<a href="#" class="easyui-linkbutton btn2" iconCls="">2</a>
					<a href="#" class="easyui-linkbutton btn2" iconCls="">3</a>
					<a href="#" class="easyui-linkbutton btn2" iconCls="">4</a>
					<a href="#" class="easyui-linkbutton btn2" iconCls="">5</a>
					<a href="#" class="easyui-linkbutton btn2" iconCls="">6</a>
    			</div>
				<ol type="1" class="borderw" style="padding-left: 40px;">
					<c:forEach items="${opinion.opinions}" var="o" varStatus="status">
						<li class="li_question">
							<div class="question_title">
								<input type="hidden" name="answeroid" value="${o.id }" /> <label>
									${status.index+1}、
										<c:choose>
											<c:when test="${opinion.opinionsanswer[status.index].answer != o.answer}">
												<input  name="judge_score" type="text" style="width: 50px;text-align: center; font-weight:bold; color:red;" value="0">
											</c:when>
											<c:otherwise>
												<input class="" id="" type="text" name="judge_score"  style="width: 50px;text-align: center;font-weight:bold;color:blue;">
											</c:otherwise>
										</c:choose>
									${o.title} <c:choose>
										<c:when
											test="${empty opinion.opinionsanswer[status.index].answer}">
											<font color="red">未答</font>
											
										</c:when>
										<c:when
											test="${opinion.opinionsanswer[status.index].answer != o.answer}">
											<span class="correct_answer"> <font color="red">${opinion.opinionsanswer[status.index].answer}</font>
											</span>
										</c:when>
										<c:otherwise>
											<span class="correct_answer">${opinion.opinionsanswer[status.index].answer}</span>
										</c:otherwise>
									</c:choose> <c:if
										test="${opinion.opinionsanswer[status.index].answer != o.answer}">
					 						 (正确答案：${o.answer})
								  			</c:if>
							</div>
						</li>
					</c:forEach>
				</ol>
			</fieldset>
				</c:if>
				<c:if test="${not empty program.programs}">
			<fieldset
				style="border: none; width: 96%; margin-top: 10px; margin-left: 20px;">
				<legend style="font-weight: bold; padding-bottom: 10px;">编程题(共${program.programs.size()}题)</legend>
				<div>
		    		<input class="easyui-textbox"  name="pc" style="width: 50px;text-align: center;">
					<a href="#" id="btn3" class="easyui-linkbutton btn3" iconCls="">统一设置分数</a>
					<a href="#" class="easyui-linkbutton btn3" iconCls="">10</a>
					<a href="#" class="easyui-linkbutton btn3" iconCls="">20</a>
					<a href="#" class="easyui-linkbutton btn3" iconCls="">30</a>
					<a href="#" class="easyui-linkbutton btn3" iconCls="">40</a>
					<a href="#" class="easyui-linkbutton btn3" iconCls="">50</a>
					<a href="#" class="easyui-linkbutton btn3" iconCls="">60</a>
    			</div>
				<ol type="1" class="borderw" style="padding-left: 40px;">
					<c:forEach items="${program.programs}" var="p" varStatus="status">
						<li class="li_question"><input type="hidden" name="answerpid"
							value="${p.id }" />
							<div class="question_title">
								${status.index+1}、
								<pre>${p.title}</pre>
							</div>
							<c:choose>
								<c:when test="${empty program.programsanswer[status.index].answer}">
									<font color="red">未答</font>
								</c:when>
								<c:otherwise>
									<pre>${program.programsanswer[status.index].answer}</pre>
								</c:otherwise>
							</c:choose>
							<p>
						<textarea id="ts_${p.id}" class="saying" data-id="${p.id}" name="teacher_saying" placeholder="请输入评语" style="width:50%;margin-top:20px;height:80px;resize: none;"></textarea>
						</p>
						<div>
							<span>评分：</span><input data-id="${p.id}" name="program_score" type="text" style="width: 50px;text-align: center;font-weight:bold; color:blue;">
							快捷点评：
							<select id="qi_${p.id}" class="" data-id="${p.id}">
								<option></option>
								<optgroup label="问题">
									<option>没有上传运行效果图</option>
									<option>功能不完整</option>
									<option>格式混乱，请注意排版</option>
									<option>没有按要求完成</option>
									<option>答案不够详细</option>
									<option>思路不对</option>
									<option>你一定是在坑我！</option>
									<option>代码缺失！</option>
								</optgroup>
								<optgroup label="点赞">
									<option>这道题做得不错。</option>
									<option>这种做法非常好，标新立异</option>
									<option>最近表现不错，加油！！！</option>
									<option>赞一个</option>
									<option>不错</option>
								</optgroup>
							</select>						
						</div>
						<div style="margin-top: 8px; margin-bottom: 8px;">
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">0</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">10</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">20</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">30</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">40</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">50</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">60</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">70</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">80</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">90</a>
							<a href="#" data-id="${p.id}" class="easyui-linkbutton btn4" iconCls="">100</a>
						</div>
							</li>
					</c:forEach>
				</ol>
			</fieldset>
			</c:if>
		</div>
			<input type="hidden" name="workid" value="${ct.id}">
			<input type="hidden" name="stuid" value="${stu.id}">
		</form>
			<a href="#" id="save_score" class="easyui-linkbutton" iconCls="icon-save" style="position: absolute;right: 117px;bottom: 10px;">保存分数</a>
			<a href="#" id="ongrade" class="easyui-linkbutton" iconCls="icon-sum" style="position: absolute;right: 206px;bottom: 10px;">统计分数</a>
		</div>
</div>
<script type="text/javascript" src="public/js/marking_homework.js"></script>

